package com.state.self;

public class AlibabaCompany {

    public EmployeeState employee;
    public int empty;

    private EmployeeState hiredState = new HiredState(this);
    private EmployeeState unHiredState = new UnHiredState(this);

    public AlibabaCompany(int empty) {
        this.employee = getUnHiredState();
        this.empty = empty;
    }

    public void exam(){
        this.employee.exam();
    }

    public int getEmpty() {
        int current=empty;
        empty--;
        return current;
    }

    public void sendOffer(){
        if(this.employee.isHire()) {
            this.employee.sendOffer();
        }
    }

    public void setEmployee(EmployeeState employee) {
        this.employee = employee;
    }

    public EmployeeState getHiredState() {
        return hiredState;
    }

    public void setHiredState(EmployeeState hiredState) {
        this.hiredState = hiredState;
    }

    public EmployeeState getUnHiredState() {
        return unHiredState;
    }

    public void setUnHiredState(EmployeeState unHiredState) {
        this.unHiredState = unHiredState;
    }
}
